package com.ithuangyl.common.config;

import android.app.Application;
import android.content.Context;

/**
 * author : itHuang
 * e-mail : ithuangyl@163.com
 * date   : 2020/7/11 20:36
 */
public class Latte {
    public static Configurator init(Context context) {
        Configurator configurator = Configurator.get();
        configurator.withApplicationContext(context.getApplicationContext());
        return configurator;
    }

    public static Configurator getConfigurator() {
        return Configurator.get();
    }

    public static <T> T getConfiguration(Object key) {
        return getConfigurator().getConfiguration(key);
    }

    public static Application getApplicationContext() {
        return getConfiguration(ConfigKeys.APPLICATION_CONTEXT);
    }
}
